<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Common\Model;
use Think\Model;
class AreaModel extends Model{
    protected $_validate = array(

    );
    /* 用户模型自动完成 */
    protected $_auto = array(

    );

   public function province($pid=0){
       $s = 'province'.$pid;
       $volist = S($s);
       if(empty($volist)){
       $map =array();
       $map['pid']=array('eq',$pid);//710000 810000 820000
       $map['id']=array(array('neq',710000),array('neq',810000),array('neq',820000),'AND');
       $volist =  $this->where($map)->field('id as value,name as label')->select();
           S($s,$volist,3600);
       }
       return $volist;
   }
    //11,11,11
   public function get_addr($id){
       $map=array();
       $map['id'] = array('in',$id);
       $volist =  $this->where($map)->order('id asc')->select();
       $str = '';
       foreach($volist as $v){
           $str .= $v['name'];
       }
       return $str;
   }


}
